using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BaseSchemaMap : EntityTypeConfiguration<t_BaseSchema>
    {
        public t_BaseSchemaMap()
        {
            // Primary Key
            this.HasKey(t => t.FID);

            // Properties
            this.Property(t => t.FID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FEnglishName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FChineseName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FDataType)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FMinOccurs)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FMaxOccurs)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FDefault)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FEnum)
                .IsRequired()
                .HasMaxLength(1000);

            this.Property(t => t.FPattern)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FICRsFieldName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FICFieldName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FICTableName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FComFieldName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FComTableName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FArApFieldName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FArApTableName)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("t_BaseSchema");
            this.Property(t => t.FID).HasColumnName("FID");
            this.Property(t => t.FBillTypeID).HasColumnName("FBillTypeID");
            this.Property(t => t.FEnglishName).HasColumnName("FEnglishName");
            this.Property(t => t.FChineseName).HasColumnName("FChineseName");
            this.Property(t => t.FDataType).HasColumnName("FDataType");
            this.Property(t => t.FLength).HasColumnName("FLength");
            this.Property(t => t.FPrecision).HasColumnName("FPrecision");
            this.Property(t => t.FMinOccurs).HasColumnName("FMinOccurs");
            this.Property(t => t.FMaxOccurs).HasColumnName("FMaxOccurs");
            this.Property(t => t.FDefault).HasColumnName("FDefault");
            this.Property(t => t.FEnum).HasColumnName("FEnum");
            this.Property(t => t.FIsKey).HasColumnName("FIsKey");
            this.Property(t => t.FNillable).HasColumnName("FNillable");
            this.Property(t => t.FPattern).HasColumnName("FPattern");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FICRsFieldName).HasColumnName("FICRsFieldName");
            this.Property(t => t.FICFieldName).HasColumnName("FICFieldName");
            this.Property(t => t.FICTableName).HasColumnName("FICTableName");
            this.Property(t => t.FComFieldName).HasColumnName("FComFieldName");
            this.Property(t => t.FComTableName).HasColumnName("FComTableName");
            this.Property(t => t.FArApFieldName).HasColumnName("FArApFieldName");
            this.Property(t => t.FArApTableName).HasColumnName("FArApTableName");
            this.Property(t => t.FTypeGroup).HasColumnName("FTypeGroup");
            this.Property(t => t.FDetail).HasColumnName("FDetail");
            this.Property(t => t.FRefId).HasColumnName("FRefId");
            this.Property(t => t.FIsImport).HasColumnName("FIsImport");
            this.Property(t => t.FPosition).HasColumnName("FPosition");
            this.Property(t => t.FIfHasDeleted).HasColumnName("FIfHasDeleted");
        }
    }
}
